package com.wxx.main;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.Random;
import java.util.UUID;

import net.sf.json.JSONArray;
import net.sf.json.JSONObject;

public class MainXH {

	@SuppressWarnings("unused")
	public static void main(String[] args) {
		
		
		Map<String, Object> responseMap = new HashMap<String, Object>();
		Map<String, Object> responseMap1 = new HashMap<String, Object>();
		Map<String, Object> responseMap2 = new HashMap<String, Object>();
		JSONObject resJson = new JSONObject();
		JSONObject resJson1 = new JSONObject();
		JSONArray items1 = new JSONArray();
		JSONArray items2 = new JSONArray();
		JSONObject resJson2 = new JSONObject();
		
		
		responseMap1.put("accountTypeID", ">");
		responseMap1.put("mainCurrency", ">");
		responseMap1.put("institutionId", ">");
		
		
		resJson2.put("resJson1", "1");
		resJson2.put("resJson2", "2");
		resJson2.put("resJson3", "3");
		resJson2.put("resJson4", "3");
		items2.add(responseMap1);
		items2.add(responseMap1);
		
		
		resJson1.put("accountTypeID", "1");
		resJson1.put("mainCurrency", "CNY");
		resJson1.put("institutionId", "1");
		resJson1.put("maxAmtTransactedAllow", "1");
		resJson1.put("maxNumTxns", "");
		resJson1.put("productID", "1");
		resJson1.put("amountID", "1");
		resJson1.put("activeFlag", "1");
		resJson1.put("items2", items2);
		
		String uuid = UUID.randomUUID().toString().replaceAll("-", "");
		//System.out.println("++++++++++++++++++++"+uuid.substring(0, 6));
		Random random = new Random();
		int x =random.nextInt(999999999);
		System.out.println("+>>>>x>>>>>>>"+x);
		items1.add(resJson1);
		items1.add(resJson1);
		//String payUuid  =dateToStrYyyyMMddHHmmss(new Date());
		//System.out.println("+>>>>payUuid>>>>>>>"+payUuid);
		resJson.put("items1", items1);
		//System.out.println(">>>>>>>>>>>"+resJson.toString());
		
		System.out.println(">>>>>>666666666>>>>>"+getLengthStr(""));
		
		
		responseMap.put("items1", items1);
		System.out.println("-----------------"+responseMap.toString());
	}
	public static String dateToStrYyyyMMddHHmmss(Date date){
		SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmss");
		return format.format(date);
	}

	private static String getLengthStr(String length) {
		if (length.length() < 3) {
			int zeroNum = 3 - length.length();
			for (int i = 0; i < zeroNum; i++) {
				length = "0" + length;
			}
		}
		return length;
	}
}
